package logic;

public class Turniquette implements TurniquetteInterface{
	private CardDataBase cardBase;
	
	public Turniquette( CardDataBase cardDataBase){
            this.cardBase = cardDataBase;
	}
        
	@Override
	public boolean canPass( MetroCard card ){
		boolean answer = false;
		
		if ( cardBase.findCard(card) ){
                    answer = card.checkPass();
		}
		cardBase.addLog( card, answer);
		
		return false;
	}
        
        @Override
        public String print(){
            return cardBase.printLog();
        }
        
        @Override
        public String print( CardType cardType){
            return cardBase.printLog(cardType);
        }
}
